﻿using Newtonsoft.Json.Serialization;

namespace Lucilla.Framework.Web.Builders.SlickGrid
{
    public class UnderscoreCamelCasePropertyNamesContractResolver : CamelCasePropertyNamesContractResolver
    {
        protected override string ResolvePropertyName(string propertyName)
        {
            propertyName = base.ResolvePropertyName(propertyName);
            
            if (propertyName.StartsWith("_"))
                return propertyName.Substring(1);

            return propertyName;
        }
    }
}